import { cloud, default as request } from '@/framework/utils/request'

/**
 * @Description: 订单详情  /tModOrder/getOrderDetails
 * @param params
 */
export function getOrderDetails(params) {
  return request({
    url: `${cloud.mall}/tModOrder/getOrderDetails`,
    method: 'get',
    params
  })
}

/**
 * @Description: 申请退款 /tModOrderReject/add
 * @param data
 */
export function applyRefund(data) {
  return request({
    url: `${cloud.mall}/tModOrderReject/add`,
    method: 'post',
    data
  })
}

/**
 * @Description: 审核退款 /tModOrderReject/approval
 * @param data
 */
export function auditRefund(data) {
  return request({
    url: `${cloud.mall}/tModOrderReject/approval`,
    method: 'post',
    data
  })
}

/**
 * @Description: /tMallInfo/getMallInfoByMallCode
 * @param data
 */
export function getMallInfoByMallCode(data) {
  return request({
    url: `${cloud.mall}/tMallInfo/getMallInfoByMallCode`,
    method: 'get',
    params: data
  })
}

/**
 * @Description: 单条数据 /tMallInfo/detail
 * @param data
 */
export function getMallInfoDetail(data) {
  return request({
    url: `${cloud.mall}/tMallInfo/detail`,
    method: 'get',
    params: data
  })
}

/**
 * @Description: 审核退款 /tModOrderReject/approval
 * @param data
 */
export function getRefundList(data) {
  return request({
    url: `${cloud.mall}/tModOrderReject/getList`,
    method: 'get',
    params: data
  })
}

/**
 * @Description: 打款 /tModOrderReject/payment
 * @param data
 */
export function remittance(data) {
  return request({
    url: `${cloud.mall}/tModOrderReject/payment`,
    method: 'post',
    data
  })
}
